#pragma once

class SplitterApplet : public AWTApplet
{
public:
	SplitterApplet(CWnd* parent) : AWTApplet(parent){};
	virtual ~SplitterApplet(){};

	virtual void init();
	virtual void start(){};
	virtual void stop(){};
	virtual void destroy(){};
};

class HelloPanel : public AWTPanel
{
public:
	HelloPanel()
	{
		add(new AWTLabel("Hello World!"));
	}
};

class BorderLayoutPanel : public AWTPanel, public AWTActionListener
{
public:
	BorderLayoutPanel()
	{
		setLayout(new AWTBorderLayout());
		((AWTButton*)add("North", new AWTButton("North")))->addActionListener(this);
		((AWTButton*)add("West", new AWTButton("West")))->addActionListener(this);
		((AWTButton*)add("Center", new AWTButton("Center")))->addActionListener(this);
		((AWTButton*)add("East", new AWTButton("East")))->addActionListener(this);
		((AWTButton*)add("South", new AWTButton("South")))->addActionListener(this);
	}
	void actionPerformed(AWTActionEvent* e)
	{
		AfxMessageBox("You clicked " + ((AWTButton*)e->getSource())->getName());
	}
};

class BrowserPanel : public AWTPanel
{
public:
	BrowserPanel()
	{
		setLayout(new AWTBorderLayout());
		add("Center", new Browser("http://www.codeplex.com/awt4mfc"));
	}
};
